﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Newtonsoft.Json.Linq;
using xbmc_json_async.System;

namespace xbmc_json_async.Media
{
    public class MovieSet : xbmc_json_async.Types.Video.Details.MovieSet
    {
        public MovieSet() { }

        /// <summary>
        /// Froms the json object.
        /// </summary>
        /// <param name="item">The item.</param>
        /// <returns></returns>
        public static MovieSet FromJsonObject(JObject item)
        {
            var set = new MovieSet();
            set.fanart = XHelpers.Jval(item, "fanart");
            set.label = XHelpers.Jval(item, "label");
            set.playcount = XHelpers.JvalInt(item, "playcount");
            set.setid = XHelpers.JvalInt(item, "setid");
            set.thumbnail = XHelpers.Jval(item, "thumbnail");
            set.title = XHelpers.Jval(item, "title");

            return set;
        }
    }
}
